#include <iostream>
#include <boost/program_options.hpp>
#include <string>
#include <math.h>
#include "get_arg.h"


// link with -lboost_filesystem-gcc -lboost_program_options-gcc
// program_options_helper.cpp

#define DEBUG_LEVEL 6
#include <debug_func.h>


// my functions
#include <print_error.h>
#include <program_options_helper.h>

using std::string;
using std::cerr;
using namespace program_options_helper;
namespace po = boost::program_options_lg;


//_______________________________________________________________________________________

//		process_command_line_options

//				from command line
//				Created [9/13/2001]

//_______________________________________________________________________________________
bool process_command_line_options(int argc, char* argv[], t_program_args& args)
{
//	po::options_description mandatory_args("Mandatory Arguments");
//	mandatory_args.add_options()
//	("species_tree,s", po::value<string>(&args.file_species)
//											->set_name("FILE"),
//									"File containing species tree in New Hampshire format.");


	args.add_std_options();
	po::options_description all_args("");
	all_args.add(args.optional_args)
//							.add(mandatory_args)
							;

	// parse command line
	po::variables_map vm;
	po::store(po::command_line_parser(argc, argv).options(all_args).run(), vm);
	po::notify(vm);

	if (vm.count("version"))
	{
		print_version(cerr, *argv, "1.0\n"
			"\tHistory: \n\n"
			"\tv 1.0\1"
			"03-05-2005\1"
			"Initial version\n"
//			"\tv 1.1\1"
//			"01-02-2005\1"
//			"Split programme so that vanilla version does not do anything with matrices.\n"
			);
		return false;
	}
	if (vm.count("help"))
	{
		string exe_description =
				"Takes species tree from STDIN and constructs mapping tables:\n\n"
				"The [Duplications] table specifies the number of inferred (parsimonious) "
				"duplications when transvering a gene tree.\n"
				"The [Deletions] table specifies the number of inferred (parsimonious) "
				"deleted/missing genes when transvering a gene tree.\n"
				"The [Transitions] table allows the transversal and reconciliation of a "
				"gene tree with this species tree.\n"
				"The [Transition Node Names] table specifies the names of the inferred "
				"speciation points when transvering a gene tree.\n\n";

		print_usage(cerr, string(*argv), "[OPTIONS] < SPECIES.NH > MAPPING.TABLES",
							all_args, exe_description, 80);
		return false;
	}

	return true;
}






